<?php //session_start();
global $wpdb;
$visit_count = $wpdb->get_var( "SELECT value FROM wp_draft WHERE ID = 2");
$visit_count=$visit_count+1;
$wpdb->query("UPDATE wp_draft SET value=".$visit_count." WHERE ID = 2");
LuuThongTin();
?>     
  <div class="cy-content-left-item">    
  <h3>
   <div class="thong-ke-truy-cap">
    </div><!--thong-ke-truy-cap-->
  </h3>
    <?php  
		global $wpdb;
		$visit_count_show = $wpdb->get_var( "SELECT value FROM wp_draft WHERE ID = 2");
		// Make a MySQL Connection
		$query = "SELECT sum( if( username <>'' , 1 , 0 ) ) As SoThanhVien, 
				sum( if( username ='' , 1 , 0 ) ) As SoKhach , 
				count(*) As TongSoNguoi 
				FROM wp_sessions"; 
		$result = mysql_query($query) or die(mysql_error());
		?>
  <div class="textnd">
    <p>
      Lượt truy cập :
      <span class="counter"><?php echo $visit_count_show;?></span></p>
    <p>
      Số người online :
      <span class="online">
      <?php
											// Print out result
											while($row = mysql_fetch_array($result)){
												echo  $row['TongSoNguoi'];
											}
											?>
      </span></p>
  </div>
  <!--textnd--> 
</div><!--cy-content-left-item-->

